public class SwapExample {
    public static void main(String[] args) {
        System.out.println(sum(10));
    }
    public static int sum(int n){
        if(n == 10){
            return 1;
        }else {
            return n+sum(n/2)+1;
        }
    }
}
/*    public static void main(String[] args) {

        System.out.println(sum(5));
    }
    public static int sum(int n){
        if (n == 1){
            return 1;
        }else {
            return n+sum(n-1);
        }
    }
}*/

/*    public static void main(String[] args) {
        System.out.println(fun(5));

    }
    public static int fun(int n){

        if (n == 1){
            return 1;
        }else {
            return n * fun(n-1);
        }
    }
}*/
/*    public static void main(String[] args) {
        Swap a = new Swap();
        a.data = 10;

        Swap b = new Swap();
        b.data = 5;
        swapE(a,b);
        System.out.println(a.data+" "+b.data);
    }
    public static void swapE(Swap a,Swap b){
        Swap temp = new Swap();
        temp.data = a.data;
        a.data = b.data;
        b.data = temp.data;
    }
}*/
/*    public static void main(String[] args) {
        int a = 10;
        int b = 5;
        swap(a,b);
        System.out.println(a+" "+b);

    }
    public static void swap(int a,int b){

}            int temp = a;
            a = b;
                    b = temp;
                    }*/
/*    public static void main(String[] args) {
        Integer a = 10;
        Integer b =5;
        swap(a,b);
        System.out.println(a);
        System.out.println(b);
    }
    public static void swap(Integer a,Integer b){
        Integer temp = b;
        int a1 = a;
        b = a1;

        int temp1 = temp;
        a = temp1;
    }
}*/
/*    public static void main(String[] args) {
        int a = 5;
        int b = 10;

        System.out.println("交换前：a = " + a + ", b = " + b);

        swapValues(a, b);

        System.out.println("交换后：a = " + a + ", b = " + b);
    }

    public static void swapValues(int x, int y) {
        int temp = x;
        x = y;
        y = temp;
    }
}*/

/*    public static void main(String[] args) {
        int n = 24;
        int m = 18;
        while (true){
            if (m%n != 0){
                int temp = m%n;
                m = n;
                n = temp;
            }else if (m%n == 0){
                System.out.println(n);
                break;
            }
        }

    }
}*/
/*    public static void main(String[] args) {
        for (int i = 1; i <= 9 ; i++) {
            for (int j = 1; j <= i ; j++) {
                System.out.print(i + "*" + j + "=" + i*j+" ");
            }
            System.out.println();
        }
    }
}*/

/*
    public static void main(String[] args) {
        int i = 1;
        while (i <= 100){
            if (i % 3 == 0 && i % 5 == 0){
                System.out.println(i);
            }
            i++;

        }
    }
}
*/
